package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.example.demo.annotation.Join;
import com.example.demo.annotation.JoinField;
import com.example.demo.annotation.PreDataProxy;
import com.example.demo.service.proxy.UserProxy;
import com.example.demo.view.ModelItem;
import com.example.demo.view.ModelView;
import com.example.demo.view.el.ElDatePicker;
import com.example.demo.view.el.ElType;
import lombok.Data;

import java.util.Date;

@Data
@PreDataProxy(UserProxy.class)
@ModelView
public class User {


    public User() {

    }

    @ModelItem(title = "ID")
    private Long id;

    @ModelItem(title = "名字",filter = true,required = true)
    private String name;

    @ModelItem(title = "时间",filter = true,picker = ElDatePicker.DATE_TIME,format = "yyyy/MM/dd HH:mm:ss")
    private Date time;

    @ModelItem(title = "生日",filter = true,hide = true)
    private Date birth;

    @ModelItem(type = ElType.SELECT,title = "状态",options = {"未激活","激活"},filter = true)
    private Integer status;

    @ModelItem(title = "头像",type = ElType.UPLOAD,disabled = true)
    private String img;

    @ModelItem(title = "年龄")
    private Integer age;


    @JoinField
    @TableField(exist = false)
    private Room room;

    private Long room_id;

    @JoinField(fk = "book_name_id")
    private BookName bookName;

    private Long book_name_id;

    @TableField(exist = false)
    private Date timeStart;

    @TableField(exist = false)
    private Date timeEnd;

    @TableField(exist = false)
    private Date birthEnd;

    @TableField(exist = false)
    private Date birthStart;



}
